
/*
$(document).ready(function() {

      
    
    $(function() {
    $( "#slider" ).slider({
      value: 0,
      min: 0,
      max: 100,
      step: 25,
      slide: function( event, ui ) {
        var index = 0;
        var array=['Opciones:','Usuarios:','Grupos:','Departamentos:','Proyectos:','Eventos:'];
        var grupos = $("#u_grupos option").length;
        switch(ui.value)
        {
          case 0:
            $("#form_usuario").fadeOut('slow');
            break;
          case 25:
            index = 1;
            $("#form_grupos").slideUp('swing');
            $("#form_usuario").slideDown('swing',function(){
                if ( grupos == 0)
                {
                  $.post(
                      //method:"POST",
                      "/comunidadcyt/gruposInvestigacion/listar/ajax/xhr/",
                      function(data){
                        for (item in data.list){
                          $("#u_grupos").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                        }
                        $("#u_grupos").multiselect('refresh');
                      },
                      "json"
                     );
                }
                
                if ($("#u_cargo").attr("options").length == 0)
                {
                  $.post(
                      //method:"POST",
                      "/comunidadcyt/cargos/list/xhr/",
                      function(data){
                        for (item in data.list){
                          $("#u_cargo").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                        }
                        $("#u_cargo").multiselect('refresh');
                      },
                      "json"
                     );
                }
                
                if ($("#u_proyecto").attr("options").length == 0)
                {
                  $.post(
                      //method:"POST",
                      "/comunidadcyt/proyectos/listar/ajax/xhr/",
                      function(data){
                        for (item in data.list){
                          $("#u_proyecto").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                        }
                        $("#u_proyecto").multiselect('refresh');
                      },
                      "json"
                     );
                }
              });
            break;
          case 50:
            index = 2;
            $("#form_usuario").slideUp('swing');
            $("#form_departamentos").slideUp('swing');
            $("#form_grupos").slideDown('swing',function(){
              if ($("#members").attr("options").length == 0)
              {
                $.post(
                      //method:"POST",
                      "/comunidadcyt/accounts/ajax/list/xhr/",
                      function(data){
                        for (item in data.list){
                          $("#members").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                        }
                        $("#members").multiselect('refresh');
                      },
                      "json"
                     );
              }
              
              if ($("#projects").attr("options").length == 0)
              {
                $.post(
                      //method:"POST",
                      "/comunidadcyt/proyectos/listar/ajax/xhr/",
                      function(data){
                        for (item in data.list){
                          $("#projects").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                        }
                        $("#projects").multiselect('refresh');
                      },
                      "json"
                     );
              }
            });
            break;
          case 75:
            index = 3;
            $("#form_grupos").slideUp('swing');
            $("#form_proyectos").slideUp('swing');
            $("#form_departamentos").slideDown('swing');
            
            if ($("#director").attr("options").length == 0)
            {
              $.post(
                  //method:"POST",
                  "/comunidadcyt/departamentos/ajax/director/list/xhr/",
                  function(data){
                    for (item in data.list){
                      $("#director").append( '<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                    }
                    $("#director").multiselect('refresh');
                  },
                  "json"
                 );
            }
            
            if ( $("#d_grupos").attr("options").length == 0)
            {
              $.post(
                  //method:"POST",
                  "/comunidadcyt/gruposInvestigacion/listar/ajax/xhr/",
                  function(data){
                    for (item in data.list){
                      $("#d_grupos").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                    }
                    $("#d_grupos").multiselect('refresh');
                  },
                  "json"
              );
            }
            break;
          case 100:
            index = 4;
            $("#form_departamentos").effect('fold','slow');
            $("#form_proyectos").slideDown('swing');
            if ( $("#p_grupos").attr("options").length == 0)
            {
              $.post(
                  //method:"POST",
                  "/comunidadcyt/gruposInvestigacion/listar/ajax/xhr/",
                  function(data){
                    for (item in data.list){
                      $("#p_grupos").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                    }
                    $("#p_grupos").multiselect('refresh');
                  },
                  "json"
              );
            }
            
            if ($("#financiacion").attr("options").length == 0)
                {
                  $.post(
                      //method:"POST",
                      "/comunidadcyt/proyectos/financiacion/list/ajax/xhr/",
                      function(data){
                        for (item in data.list){
                          $("#financiacion").append('<option value="'+data.list[item]+'">'+data.list[item]+'</option>');
                        }
                        $("#financiacion").multiselect('refresh');
                      },
                      "json"
                     );
                }
            break;
        }
        $( "#categories" ).val( array[index] );
      }
    });
    if ($( "#categories" ).val() != 0) {
		$( "#categories" ).val($( "#slider" ).slider( "value" ) );
    } else {
		$( "#categories" ).val( 'Opciones:');
    }
  });
  

  
  $(document).ready(function(){
          $('#g_fecha_creacion_ge').datepicker({showAnim: 'slide',
                                                changeMonth: true,
                                                changeYear: true,
                                                dateFormat: 'yy-mm-dd'});
          $('#g_fecha_creacion_le').datepicker({showAnim: 'slide',
                                                changeMonth: true,
                                                changeYear: true,
                                                dateFormat: 'yy-mm-dd'});
                                                
          $('#d_fecha_creacion_ge').datepicker({showAnim: 'slide',
                                                changeMonth: true,
                                                changeYear: true,
                                                dateFormat: 'yy-mm-dd'});
                                                
          $('#d_fecha_creacion_le').datepicker({showAnim: 'slide',
                                                changeMonth: true,
                                                changeYear: true,
                                                dateFormat: 'yy-mm-dd'});
                                                
          $('#p_fecha_creacion_ge').datepicker({showAnim: 'slide',
                                                changeMonth: true,
                                                changeYear: true,
                                                dateFormat: 'yy-mm-dd'});
                                                
          $('#p_fecha_creacion_le').datepicker({showAnim: 'slide',
                                                changeMonth: true,
                                                changeYear: true,
                                                dateFormat: 'yy-mm-dd'});                                              
  
          $("#u_grupos").multiselect({
            header: 'Participa en:',
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",400]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
          
          $("#u_cargo").multiselect({
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
          
          $("#u_proyecto").multiselect({
            multiple: true,
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
          
          $("#members").multiselect({
            multiple: true,
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
          
          $("#projects").multiselect({
            multiple: true,
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
                        
            $("#director").multiselect({
            multiple: true,
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
                        
            $("#d_grupos").multiselect({
            multiple: true,
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
                        
            $("#p_grupos").multiselect({
            multiple: true,
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
                        
            $("#financiacion").multiselect({
            multiple: true,
            minWidth:'200',
            show: ["bounce",200],
            hide: ["explode",200]
          }).multiselectfilter({
                              filter: function(event, matches){
                                // find the first matching checkbox
                                var first_match = $( matches[0] );
                                
                                }
                        });
    });

});
*/